class User:
    def __init__(self, name, pwd):
        self.name = name
        self.pwd = pwd

    def valiadLogin(self):
        print("valiad %s login" % self.name)


u = User('xiaowang', 'adssq')
print(hasattr(u.name, '__call__'))
print(hasattr(u.valiadLogin, '__call__'))


class Role:
    def __init__(self, name):
        self.name = name

    def __call__(self):
        print('execute Role Object')


r = Role('Admin')
r()


def foo():
    print('---foo function---')


foo()
foo.__call__()
